package be.gnx.logging4eclipse.perspective.action;

import org.eclipse.jface.action.Action;

import be.gnx.logging4eclipse.log4j.Log4JListener;
import be.gnx.logging4eclipse.perspective.view.Logging4EclipseView;

public class StartStopServerAction extends Action {

  private Logging4EclipseView log4JEclipseView;

  public StartStopServerAction(Logging4EclipseView log4JEclipseView) {
    this.log4JEclipseView = log4JEclipseView;
  }

  @Override
  public void run() {
    if (!log4JEclipseView.isServerRunning()) {
      Log4JListener.getInstance().start(true);
    }
    super.run();
  }

}
